//
//  MyTableViewCell.m
//  17-HomeWork(通讯录)
//
//  Created by ParkourH on 16/8/6.
//  Copyright © 2016年 ParkourH. All rights reserved.
//

#import "MyTableViewCell.h"

@interface MyTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageOfContact;

@property (weak, nonatomic) IBOutlet UILabel *labelOfContactName;

@property (weak, nonatomic) IBOutlet UILabel *labelOfContactPhoneNumber;

@end

@implementation MyTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


- (void)setContact:(Contact *)contact {

    _contact = contact;
    
    if (contact.image == nil) {
    
        self.imageOfContact.image = [UIImage imageNamed:@"contact"];
    } else {
    self.imageOfContact.image = contact.image;
    }
    self.labelOfContactName.text = contact.name;
    self.labelOfContactPhoneNumber.text = [NSString stringWithFormat:@"%ld", contact.phoneNumber];
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
